﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>选择科室。。。</title>
    <script src="~/Scripts/jquery-1.6.4.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html, body {
            width: 100%;
            height: 100%;
        }

        #box {
            width: 100%;
            height: 100%;
            overflow: hidden;
            /*margin-top:1rem*/
        }

        #box div {
            float: left;
        }

        .ksdl {
            width: 40%;
            height: 100%;
            overflow: auto;
        }


        .ksmc {
            width: 60%;
            height: 100%;
            overflow: auto;
        }
        td {
            width:100%;
            font-size:.3rem;
            text-align:left;
          
        }
        tr {
            height:1rem;
        }
        #tabksdl td {
             background-color:#E0DEDF;
              padding-left:.2rem
        }
        .ksdl_left {
            width:3%;height:1rem; background-color:#7BAFF7;margin-left:-0.2rem
        }
        .ksdl_right {
           width:97%;margin-top:.3rem;color:#7BAFF7;
        }

        #tabksmc td {
            padding-left:.3rem
        }

     
       
    </style>
    <script>!function(e){function t(a){if(i[a])return i[a].exports;var n=i[a]={exports:{},id:a,loaded:!1};return e[a].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=window;t["default"]=i.flex=function(e,t){var a=e||100,n=t||1,r=i.document,o=navigator.userAgent,d=o.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i),l=o.match(/U3\/((\d+|\.){5,})/i),c=l&&parseInt(l[1].split(".").join(""),10)>=80,p=navigator.appVersion.match(/(iphone|ipad|ipod)/gi),s=i.devicePixelRatio||1;p||d&&d[1]>534||c||(s=1);var u=1/s,m=r.querySelector('meta[name="viewport"]');m||(m=r.createElement("meta"),m.setAttribute("name","viewport"),r.head.appendChild(m)),m.setAttribute("content","width=device-width,user-scalable=no,initial-scale="+u+",maximum-scale="+u+",minimum-scale="+u),r.documentElement.style.fontSize=a/2*s*n+"px"},e.exports=t["default"]}]);  flex(100, 1);</script>
</head>

<body>
    <div id="box">
        <div class="ksdl">
            <table id="tabksdl" style="margin:auto" border="0" cellspacing="0" cellpadding="0" width="100%"></table>
        </div>
        <div class="ksmc">
            <table id="tabksmc" style="margin:auto" border="0" cellspacing="0" cellpadding="0" width="100%"></table>
        </div>
    </div>
   
    <script src="~/Scripts/jquery-1.6.4.js"></script>
    <script>

        $(function () {
            $.post("/Home/getksmc", function (data) {
                var html = $("#tabksdl").html();

                for (var i = 0; i < data.data.length; i++) {
                    if (i == 0) {
                        html += "<tr><td id=t_" + data.data[i].GHKS + " style='background-color:transparent;'><div class='ksdl_left'></div> <div class='ksdl_right'>" + data.data[i].KSDL + "</div></td></tr>";
                    } else {
                        html += "<tr><td id=t_" + data.data[i].GHKS + ">" + data.data[i].KSDL + "</td></tr>"
                    }
                }
                html += "<tr><td></td></tr>"
                html += "<tr><td></td></tr>"

                $("#tabksdl").html(html)

              
                showksmc("1");

                $("#tabksdl td").mousedown(function () {
                    var ksmc = $(this).html();

                    $(this).css("background-color", "transparent");
                    
                    $('#tabksdl td').not(this).css('background-color', '#E0DEDF')

                   
                    $(".ksdl_left").css({ "width": "0px", "height": "0px", "padding-left": "0rem" });
                    $(".ksdl_right").css({ "width": "100%", "margin-top": "0px", "color": "#000000" });
                    var html = "<div class='ksdl_left'></div> <div class='ksdl_right'>" + ksmc + "</div>";
                    $(this).html(html);

                    
                    showksmc($(this).attr('id').split('_')[1]);

                });

            },"json")
        })
        
        

        function showksmc(a) {
         
            $.post("/Home/getksmc", { "ksid": a }, function (data) {
                $("#tabksmc").html("");
                var html = $("#tabksmc").html();
                for (var i = 0; i < data.data.length; i++) {
                    html += "<tr><td id=k_" + data.data[i].KSDM +">" + data.data[i].KSMC + " </td></tr>"
                }

                $("#tabksmc").html(html);

                $("#tabksmc td").mousedown(function () {
                    window.location.href = "/Yygh/DoctInfo?ksdm=" + $(this).attr('id').split('_')[1]+"&ksmc="+$(this).text();

                })

            },"json")
        }
    </script>
</body>
</html>
